package com.njwt.cloud.msconsumer.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author <a href="mailto:xingxiao@gtmap.cn">xingxiaofeng</a>
 * @version2.1 2022-04-11
 * @description
 */
@Configuration
public class BaseConfig {
    
    /**
     * 负载均衡
     * 注册resttemplate
     * @return
     */
    @LoadBalanced
    @Bean
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }
    /**
     * 配置消费端的负载均衡策略
     */
 /*   @Bean
    public RandomRule randomRule() {
        return new RandomRule();
    }*/





}
